#include <iostream.h>

class Base
{
public:
Base() {cout << "In Base::Base()\n";}
virtual ~Base() {}

virtual void virtualFunc() {cout << "In Base::virtualFunc()\n";}
};

class Derived1 : virtual public Base
{
public:
Derived1() {cout << "In Derived1::Derived1()\n";}
virtual ~Derived1() {}

virtual void virtualFunc() {cout << "In Derived1::virtualFunc()\n";}
};

class Derived2 : virtual public Base
{
public:
Derived2()
{
cout << "In Derived2::Derived2()\n";

virtualFunc();
}
virtual ~Derived2() {}
};

class MostDerived : public Derived1, public Derived2
{
public:
MostDerived() {cout << "In MostDerived::MostDerived()\n";}
virtual ~MostDerived() {}
};

int main()
{
int wait;

MostDerived md;
md.virtualFunc();

cin >> wait;
}
